import { createApp } from 'vue'
import 'element-plus/dist/index.css'
import ElementPlus from 'element-plus'
import { zhCn } from 'element-plus/es/locales.mjs'
// import App from './App.vue'
import App from '@/App.vue'
import 'virtual:svg-icons-register'
// 引入自定义插件对象：注册整个项目全局组件
import globalComponent from '@/components'
import '@/styles/index.scss'
import router from '@/router/index'
import pinia from '@/stores/index'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import '@/router/permission'


const app = createApp(App)
app.use(ElementPlus, {
  locale: zhCn,
})

// 使用全局组件插件对象
app.use(globalComponent)
// 注册路由
app.use(router)
// 注册pinia
app.use(pinia)
// 注册element图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
// 挂载
app.mount('#app')


